#include <iostream>
#include <stdio.h>

using namespace std;

unsigned long long up[500];
unsigned long long rl[50000];
int main() {
    up[1] = 1;
    rl[1] = 2;
    int n;
    cin >> n;
    for(int i = 2; i <= n; i++){
        up[i] = up[i-1]+rl[i-1];
        rl[i] = up[i-1]*2+rl[i-1];
    }
    cout << up[n] + rl[n];
    return 0;
}